package com.wwl.cms.utils.designModeTest.proxy.dynamic;

/**
 * @author wwl
 * @version 1.0
 * @date 2021/9/8 19:24
 * @description:
 */
public class Client {
    public static void main(String[] args) {
        ITeacherDao target = new TecherDao();
        //给目标对象，创建代理对象，可以转成ITeacherDao
        ITeacherDao proxyInstance = (ITeacherDao)new ProxyFactory(target).getProxyInstance();
        System.out.println("proxyInstance="+proxyInstance.getClass());
        //通过代理调用目标对象
        proxyInstance.teach();
        proxyInstance.sayHello("tom");
    }
}
